package wechat.app;

import com.google.common.base.Objects;
import wechat.app.WCCorpApplication;

@SuppressWarnings("all")
public class WXCorpAppFactory {
  private static WCCorpApplication customerApp = null;
  
  public static WCCorpApplication getDefaultCorpApp() {
    WCCorpApplication _xblockexpression = null;
    {
      boolean _equals = Objects.equal(WXCorpAppFactory.customerApp, null);
      if (_equals) {
        WCCorpApplication _wCCorpApplication = new WCCorpApplication("wx59b4783059880985", "Wf2zfQ1MXhilvAvwwsIlGbMxK6__pvlGdmid8G0QT_g", "1000003");
        WXCorpAppFactory.customerApp = _wCCorpApplication;
      }
      _xblockexpression = WXCorpAppFactory.customerApp;
    }
    return _xblockexpression;
  }
  
  public static WCCorpApplication createCorpApp(final String corp_id, final String secret, final String agent_id) {
    WCCorpApplication _xblockexpression = null;
    {
      boolean _equals = Objects.equal(WXCorpAppFactory.customerApp, null);
      if (_equals) {
        WCCorpApplication _wCCorpApplication = new WCCorpApplication(corp_id, secret, agent_id);
        WXCorpAppFactory.customerApp = _wCCorpApplication;
      }
      _xblockexpression = WXCorpAppFactory.customerApp;
    }
    return _xblockexpression;
  }
  
  public static WCCorpApplication forceNewCorpApp(final String corp_id, final String secret, final String agent_id) {
    WCCorpApplication _xblockexpression = null;
    {
      WCCorpApplication _wCCorpApplication = new WCCorpApplication(corp_id, secret, agent_id);
      WXCorpAppFactory.customerApp = _wCCorpApplication;
      _xblockexpression = WXCorpAppFactory.customerApp;
    }
    return _xblockexpression;
  }
}
